/*
		ServEngine framework library
		A library to fast develop JEE online applications
	
		Copyright 2008 José Ignacio de Córdoba Álvaro

		Licensed under the Apache License, Version 2.0 (the "License");
		you may not use this file except in compliance with the License.
		You may obtain a copy of the License at

				http://www.apache.org/licenses/LICENSE-2.0

		Unless required by applicable law or agreed to in writing, software
		distributed under the License is distributed on an "AS IS" BASIS,
		WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
		See the License for the specific language governing permissions and
		limitations under the License.
	
		Jose Ignacio de Cordoba Alvaro
		http://ignacio.decordoba.com
*/

package com.servengine.user;

import com.servengine.portal.Component;
import com.servengine.portal.Portal;

import java.util.Date;

import java.util.Set;

import javax.ejb.Local;

import java.util.Collection;

import java.util.List;
import java.util.Map;

/**
 * Remote interface to UserManager session EJB
 * @see UserManagerBean

 */
@Local
public interface UserManagerLocal
{
	public Collection<User> getUsers(String portalid);
	public User getUser(String portalid, String userid);
	public User getUser(String portalid, Integer userId);
	public void createAdminUser(Portal portal, String adminuserid, String adminpassword, String adminfirstname,String adminlastname, String adminlastname2, String adminemail);
//	public User createUser(Portal portal, String userid);
	public void createAdminUsers(Portal portal);
	public UserSession getNewUserSession(String portalid, String oldUserSessionIdata);
	public List<User> getLastUsers(String portalid);
	public List<User> getNewUsers(String portalid, Date from);
	public List<UserSession> getLastUserSessions();
	public List<UserSession> getLastUserSessions(String portalid);
	public List<UserSession> getLastUserSessions(String portalid, String userid);
	public List<UserSession> getLastUserSessionsBySearchString(String portalid, String searchstring);
	public long getUserCount();
	public void persist(User user);
	public void persist(User user, Map<String,String> extraUserdataMap);
	public void persist(Role role);
	public void removeRole(String portalid, Integer roleId);
	public void signupConfirmation(User user, String signature) throws SecurityException;
	public UserSession getUserSession(String portalid, String userid, String password) throws javax.security.auth.login.FailedLoginException;
	public Set<Role> getNewUserRoles(String portalid);
	public void changeUserPassword(String portalid, String userid, String password);
	public List<User> getUsersByEmail(String email);
	public void removeUser(User user);
	public void removeUser(String portalid, String userid);
	public Collection<User> searchUsers(String portalid, Map<String, Object> searchparameters);
	public Collection<User> getUsersByRoleIds(String portalid, Integer[] roleIds);
	public String getUsersAsCSV(String portalid);
	public UserSession getGuestUserSession(String portalid);
	public boolean checkActionAccess(User user, Component action);
	public User getUserBySession(Integer userSessionId);
	public boolean isAdmin(User user);
	public Role getRole(String portalid, Integer roleId);
	public Role getRole(String portalid, String name);
	public Set<Role> getRoles(String portalid, Integer[]ids);
	public void setUserRoles(String portalid, Integer userId, Integer[] roleIds);
	public boolean exists(String portalid, String userid);
	public void setGuestUser(Portal portal, boolean value);
	public boolean hasGuestUser(String portalid);
	public Collection<User> getAdminUsers(String portalid);
	public void removeUserPicture(User user);
	public User follow(String portalid, Integer userId, String userid);
	public User unFollow(String portalid, Integer userId, String userid);
	public User acceptFriendship(String portalid, Integer userId, String userid, String signature);
	public User destroyFriendship(String portalid, Integer userId, String userid);
	public void userUnbound(Integer userSessionId);
}
